CREATE TABLE jms_dm.dm_mng_special_need_waybill_detail_dt
(
    waybill_no            varchar(100) comment '运单号',
    agent_code            varchar(100) comment '代理区编码',
    network_code          varchar(100) comment '网点编码',
    deliver_user_code     varchar(100) comment '派件员编码',
    fran_code             varchar(100) comment '加盟商区编码',
    outstore_scantime     varchar(100) comment '宽表出库时间',
    sign_scantime         varchar(100) comment '宽表签收时间',
    deliver_scansitecode  varchar(100) comment '宽表派件网点',
    outstore_scansitecode varchar(100) comment '宽表出库网点',
    sign_scansitecode     varchar(100) comment '宽表签收网点',
    deliver_user_name     varchar(100) comment '派件员名字',
    receiver_address      varchar(400) comment '收件地址',
    deliver_scantime      varchar(100) comment '派件时间',
    sign_time             varchar(100) comment '签收时间',
    is_door               varchar(100) comment '是否送货上门1是0否',
    source                varchar(100) comment '设备来源',
    business_name         varchar(300) comment '末端品牌名称',
    store_name            varchar(300) comment '门店名称',
    is_reback             varchar(100) comment '是否退转件1是0否',
    is_contact            varchar(100) comment '是否电联0否1是',
    connect_status        varchar(100) comment '0未接通1已接通本方挂断2已接通对方挂断',
    duration_seconds      varchar(100) comment '通话时长（秒）',
    is_send_msg           varchar(100) comment '是否发送短信1是0否',
    send_time             varchar(100) comment '发送时间',
    template_name         varchar(100) comment '模板名称',
    network_name          varchar(100) comment '网点名称',
    agent_name            varchar(100) comment '代理区名称',
    fran_name             varchar(100) comment '加盟商区名称',
    virt_code             varchar(100) comment '虚拟代理区编码',
    virt_name             varchar(100) comment '虚拟代理区名称',
    date_time             date comment '日期1签收日期2代表派件日期',
    type                  int comment '类型1代表1签收时间2代表派件时间'
) ENGINE = OLAP DUPLICATE KEY(waybill_no,agent_code,network_code,deliver_user_code)
COMMENT "特殊需求运单监控明细表"
PARTITION BY RANGE (date_time) (
    START ("2023-10-01") END ("2023-11-25") EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(type) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);
;